let network = require('../../utils/network.js')
Page({

  /**
   * 页面的初始数据
   */
  params:{},
  data: {
    userInfo:null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  formSubmit:function(e){
    const parmas = this.params ;

    if (parmas.userName == undefined) {
      wx.showToast({
        title: '请输入姓名',
      })
      return;
    }

    if (parmas.idCard == undefined) {
      wx.showToast({
        title: '请输入身份证号',
      })
      return;
    }

    if (parmas.idCard.length < 15) {
      wx.showToast({
        title: '请输入合法身份证号',
      })
      return;
    }

    if (parmas.mobilePhone == undefined) {
      wx.showToast({
        title: '请输入手机号',
      })
      return;
    }

    if (parmas.cardNum == undefined) {
      wx.showToast({
        title: '请输入加油卡号',
      })
      return;
    }



    console.log(parmas);
    network.requestLoading('mp/client/userGasCard/create', parmas, '请求中', (res) => {
      wx.navigateBack({
      })
    })
  },

  inputUserName:function(e){
    this.params.userName= e.detail ;
  },
  inputIdCard: function (e) {
    this.params.idCard = e.detail;

  },
  inputMobilePhone: function (e) {
    this.params.mobilePhone = e.detail;

  },
  inputCardNum: function (e) {
    this.params.cardNum = e.detail;

  }
})